package com.snj.visangedu.lib;

import android.content.Context;
import android.os.SystemClock;
import android.util.AttributeSet;
import android.widget.Chronometer;

public class SV_Chronometer extends Chronometer {
	private boolean isRunning = false;
	private long lastchecktime = 0;

    public SV_Chronometer(Context context) {
        super(context);
    }

    public SV_Chronometer(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public SV_Chronometer(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }

    @Override
    public void start() {
        super.start();
        isRunning = true;
    }

    @Override
    public void stop() {
        super.stop();
        isRunning = false;
    }

    public boolean isRunning() {
        return isRunning;
    }
    
    public void TimeCheck()
    {
    	lastchecktime = SystemClock.elapsedRealtime();
    }
    
    public long GetRecentElapsedTime()
    {
    	return (SystemClock.elapsedRealtime() - lastchecktime);
    }
}
